export const enum GlobalCustomCode {
  Undefined = -1,

  UndefinedSuccess = 0,
  UndefinedClientError = 1,
  UndefinedServerError = 2,

  Ok = 20000,

  BadRequest = 40000,
  UnAuthorized = 40001,
  Forbidden = 40003,
  NotFound = 40004,

  ServerInternalError = 50000,
  DatabaseError = 60000
}

export const globalMessage = {
  'en-US': {
    [GlobalCustomCode.Undefined]: 'Request Unknown Error',
    [GlobalCustomCode.UndefinedSuccess]: 'Request Success',
    [GlobalCustomCode.UndefinedClientError]: 'Undefined Client Error',
    [GlobalCustomCode.UndefinedServerError]: 'Undefined Server Error',

    [GlobalCustomCode.Ok]: 'Request Success',

    [GlobalCustomCode.BadRequest]: 'Client Request Argument Error',
    [GlobalCustomCode.UnAuthorized]: 'Authorization Error',
    [GlobalCustomCode.Forbidden]: 'No Permission',
    [GlobalCustomCode.NotFound]: 'Not Found',

    [GlobalCustomCode.ServerInternalError]: 'Server Internal Error',

    [GlobalCustomCode.DatabaseError]: 'Server Internal Error'
  },
  'zh-CN': {
    [GlobalCustomCode.Undefined]: '未知的请求错误',
    [GlobalCustomCode.UndefinedSuccess]: '请求成功',
    [GlobalCustomCode.UndefinedClientError]: '未定义的客户端错误',
    [GlobalCustomCode.UndefinedServerError]: '未定义的服务端错误',

    [GlobalCustomCode.Ok]: '请求成功',

    [GlobalCustomCode.BadRequest]: '客户端请求参数错误',
    [GlobalCustomCode.UnAuthorized]: 'Auth 认证失败',
    [GlobalCustomCode.Forbidden]: '无权限访问',
    [GlobalCustomCode.NotFound]: '资源不存在',

    [GlobalCustomCode.ServerInternalError]: '服务端错误',

    [GlobalCustomCode.DatabaseError]: '服务端错误'
  }
} as const
